Trò chơi Pac-Man

20.581 lượt xem;
1 using System.Collections.Generic;
2 using
UnityEngine;
3 using
UnityEngine.UI;
4
5 public
class Scores : MonoBehaviour
6 {
7     
public ScoreManager scoreManager;
8
9     Text scores_txt;
10
11     
public void UpdateGUIText(List<ScoreManager.Score> scoreList)
12     {
13         scores_txt = GetComponent<Text>();
14         Debug.Log(
"Updating GUIText: scorelist count=" + scoreList.Count);
15         
string s = "";
16         
foreach (ScoreManager.Score sc in scoreList)
17         {
18             
if (sc.score < 1000)
19                 s += sc.score +
"\t\t\t" + sc.name + "\n";
20             
else
21                 s += sc.score +
"\t\t" + sc.name + "\n";
22         }
23
24         scores_txt.text = s;
25     }
26
27 }


Gõ tìm kiếm nhanh...